<include file="Public/header" title='添加商品'/>
<div id="page-wrapper">
    <form method="post" action="{$action}" enctype="multipart/form-data">
        <input name="id" value="{$id}" type="hidden">
        <div class="form-group">
            <label>标题</label>
            <input type="text" name="good_title" class="form-control" placeholder="输入标题" value="{$update.good_title}">
        </div>
        <div class="form-group">
            <label>描述</label>
            <input type="text" name="good_bewrite" class="form-control" placeholder="输入描述" value="{$update.good_bewrite}">
        </div>
        <div class="form-group">
            <label>商品名称</label>
            <input type="text" name="good_name" class="form-control" placeholder="输入商品名称" value="{$update.good_name}">
        </div>
        <div class="form-group">
            <label>商品价格</label>
            <input type="text" name="good_price" class="form-control" placeholder="输入商品价格" value="{$update.good_price}">
        </div>
        <div class="form-group">
            <label>商品数量</label>
            <input type="text" name="stock" class="form-control" placeholder="输入商品数量" value="{$update.stock}">
        </div>
        <div class="form-group">
            <label>商品关键词</label>
            <input type="text" name="good_keyword" class="form-control" placeholder="输入商品关键词" value="{$update.good_keyword}">
        </div>
        <div class="form-group">
            <label>商品分类</label>
            <select name="good_class_id" class="form-control">
                <foreach name="classes" item="v">
                    <if condition="$update['good_class_id'] eq $v['id']">
                    <option value="{$v.id}" selected="selected">{$v.name}</option>
                    <else />
                    <option value="{$v.id}">{$v.name}</option>
                    </if>
                </foreach>
            </select>
        </div>
        <div class="form-group">
            <label>商品图片上传</label>
            <input type="file" name="photo[]" class="form-control">
            <foreach name="imgs" item="img">
            <img src="__ROOT__/Uploads/{$img.url}" width="100px" height="100px">
            </foreach>
        </div>
        <div class="form-group">
            <label>商品描述</label>
            <textarea name="depict" class="form-control" rows="3">{$update.depict}</textarea>
        </div>
        
        <button type="submit" class="btn btn-default">提交</button>
    </form>
</div>

<include file="Public/footer"/>